/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tradeplus.admin.model;

import com.tradeplus.util.SimpleMemberMappable;
import com.tradeplus.util.StringUtil;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * @author ronnie
 */
@Entity
@Table(name = "sytem_property")
public class SystemProperty implements SimpleMemberMappable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String key;
    
    private String value;
	
	
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getKey() {
            return key;
    }
    public void setKey(String key) {
            this.key = key;
    }
    public String getValue() {
            return value;
    }
    public void setValue(String value) {
            this.value = value;
    }
    public Map getSimpleMemberMap(){

        Map map = new HashMap();
        map.put("id", ""+this.getId());
        map.put("key", StringUtil.nullToZeroLengthStr(this.getKey()));
        map.put("value", StringUtil.nullToZeroLengthStr(this.getValue()));

        return map;
    }
    
}
